package com.sxbbc.common.core.enums;

import com.sxbbc.common.basics.utils.calculation.CalcuUtils;

import java.util.ArrayList;
import java.util.List;

/**
 * @author zhangq
 * @description 提鸡券状态状态枚举
 * @date 2020-3-30
 */
public enum ChickenSubscribeStatusEnums {
	SUBSCRIBE(0,"待核销"),
	USED(1,"已核销"),
	OVERDUE(2,"未核销已过期");

	private Integer id;

    private String name;

    public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	private ChickenSubscribeStatusEnums(Integer id, String name){
		this.id=id;
		this.name=name;
	}
	
	public static List<ChickenSubscribeStatusEnums> queryList(){
		List<ChickenSubscribeStatusEnums> list=new ArrayList<ChickenSubscribeStatusEnums>();
		for(ChickenSubscribeStatusEnums o: ChickenSubscribeStatusEnums.values()){
			list.add(o);
		}
		return list;
	}
	
	public static String getName(Integer id){
		String str="";
		for(ChickenSubscribeStatusEnums o: ChickenSubscribeStatusEnums.values()){
			if(CalcuUtils.getInstance().isEquals(id, o.getId())){
				str= o.getName();
				break;
			}
		}
		return str;
	}
}
